/**
 * 
 */
package com.mes.check.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.springframework.context.annotation.Lazy;

import com.mes.common.domain.BasicModel;
import com.mes.basicdata.domain.Employee;
import com.mes.basicdata.domain.TypesData;

/*import com.mes.basicdata.persistence.domain.Employee;
import com.mes.basicdata.persistence.domain.TypesData;*/

/**
 * <p>
 * 检验任务派工
 * </p>
 */
@Entity()
@Table(name = "M_CHECKTASKASSNS")
@BatchSize(size = 20)
@Lazy(value = true)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class CheckTaskAssign extends BasicModel implements java.io.Serializable {

	public final static int CHECKASSNSTATE_CREATED = 0; // 已产生
	public final static int CHECKASSNSTATE_STARTED = 2; // 已开始
	public final static int CHECKASSNSTATE_COMPLETED = 6; // 已完成
	public final static int CHECKASSNSTATE_CANCELED = 10; // 已取消
	
	@Id
	@GenericGenerator(name = "partUid", strategy = "assigned")
	@Column(name = "UNIQUEID")
	protected String checkTaskAssnUid;

	/**
	 * 复杂对象映射--checktask
	 */
	@Column(name = "CHECKTASKUID", length = 50)
	protected String checkTaskUid;
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CHECKTASKUID", insertable = false, updatable = false)
	protected CheckTask checkTask;

	/**
	 * 复杂对象映射--checker
	 */
	@Column(name = "CHECKER", length = 50)
	protected String checkerUid;
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CHECKER", insertable = false, updatable = false)
	protected Employee checker;

	/**
	 * 类型与状态映射--TypesData checkassnstatedesc;
	 */
	@Column(name = "CHECKASSNSTATE", length = 50)
	protected Integer checkAssnState;

	@Column(name = "ASSNSTART", length = 50)
	protected Date assnStart;
	@Column(name = "ASSNFINISH", length = 50)
	protected Date assnFinish;

	@Column(name = "ASSNQTY", length = 50)
	protected Float assnQty;
	// lqm todo
	// 这里有点将此表当成检验结果管理用了
	/**
	 * 完成数量
	 */
	@Column(name = "COMPLETEQTY", length = 50)
	protected Float completeQty;
	// lqm todo
	// 这里有点将此表当成检验结果管理用了
	/**
	 * 检验员是否编程
	 */
	@Column(name = "NC_PROGRAMED", length = 50)
	protected Boolean ncProgramed;

	public String getUuid() {
		// TODO Auto-generated method stub
		return this.checkTaskAssnUid;
	}

	public void setUuid(String uuid) {
		// TODO Auto-generated method stub
		this.checkTaskAssnUid = uuid;
	}

	public String getCheckTaskUid() {
		return checkTaskUid;
	}

	public void setCheckTaskUid(String checkTaskUid) {
		this.checkTaskUid = checkTaskUid;
	}

	public CheckTask getCheckTask() {
		return checkTask;
	}

	public void setCheckTask(CheckTask checkTask) {
		this.checkTask = checkTask;
	}

	public String getCheckerUid() {
		return checkerUid;
	}

	public void setCheckerUid(String checkerUid) {
		this.checkerUid = checkerUid;
	}

	public Employee getChecker() {
		return checker;
	}

	public void setChecker(Employee checker) {
		this.checker = checker;
	}

	public Integer getCheckAssnState() {
		return checkAssnState;
	}

	public void setCheckAssnState(Integer checkAssnState) {
		this.checkAssnState = checkAssnState;
	}

	public Date getAssnStart() {
		return assnStart;
	}

	public void setAssnStart(Date assnStart) {
		this.assnStart = assnStart;
	}

	public Date getAssnFinish() {
		return assnFinish;
	}

	public void setAssnFinish(Date assnFinish) {
		this.assnFinish = assnFinish;
	}

	public Float getAssnQty() {
		return assnQty;
	}

	public void setAssnQty(Float assnQty) {
		this.assnQty = assnQty;
	}

	public String getCheckTaskAssnUid() {
		return checkTaskAssnUid;
	}

	public void setCheckTaskAssnUid(String checkTaskAssnUid) {
		this.checkTaskAssnUid = checkTaskAssnUid;
	}

	public Float getCompleteQty() {
		return completeQty;
	}

	public void setCompleteQty(Float completeQty) {
		this.completeQty = completeQty;
	}

	public Boolean getNcProgramed() {
		return ncProgramed;
	}

	public void setNcProgramed(Boolean ncProgramed) {
		this.ncProgramed = ncProgramed;
	}

}
